package com.baiwei.vpnapi.entity.reqentity;

import com.baiwei.vpnapi.exception.BusinessEnum;
import com.baiwei.vpnapi.exception.PaymentException;

/**
 * @program: vpnapi
 * @description: 购买套餐输入
 * @author: Mr. Stone
 * @create: 2020-03-04 15:14
 **/
public class BuyPackageInput implements Validatable{
    public Integer getPackageId() {
        return packageId;
    }

    public void setPackageId(Integer packageId) {
        this.packageId = packageId;
    }

    private Integer packageId;

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    private String userId;
    @Override
    public void validation() {
        if(packageId == null) {
            throw new PaymentException(BusinessEnum.PAYMENT_PACKAGE_ID_EMPTY);
        }
    }

    public BuyPackageInput(Integer packageId) {
        this.packageId = packageId;
    }

    public BuyPackageInput() {
    }
}
